<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 解决方案：ImmutableJS
      const info = {
        name: "why",
        age: 20,
      };

      // const obj = info;
      const obj = {...info};

      info.name = "kobe";

      console.log(obj.name);
    </script>
  </body>
</html>
